package com.aaa.controller;

import com.aaa.entity.Emp;
import com.aaa.entity.ExamPerson;
import com.aaa.service.S_ExamService;
import com.aaa.util.EmpUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.security.Permission;
import java.util.HashMap;
import java.util.Map;

@Controller
@RequestMapping("/examLogin/")
public class S_ExamLoginController {
    @Autowired
    private S_ExamService service;


    @RequestMapping("login")
    //返回值转成json
    @ResponseBody
    public Boolean logi( ExamPerson person){
        Map map=new HashMap();
        map.put("username",person.getUsername());
        map.put("password",person.getPassword());
        //System.out.println(map);

        ExamPerson aa=new ExamPerson();
        aa.setPassword((String) map.get("password"));
        aa.setPassword((String) map.get("username"));
        //System.out.println(aa);
        EmpUtil.setExamPerson(aa);
        //EmpUtil.saveExamPerson(person);
        //System.out.println(EmpUtil.getExam().getUsername());
        //System.out.println(EmpUtil.getExam().getExam_id()+"       Esesson  id ");
        Boolean row=service.login(map);
        System.out.println(map);
        return  row;
    }
}
